﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;

namespace crmbl.Azure.Tables.Globals
{
    public class AzureTableHelper
    {
        public static TableServiceContext GetTableContext(String storageAccountName, String storageAccountKey)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(String.Format("DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}", storageAccountName, storageAccountKey));
            CloudTableClient cloudTableClient = storageAccount.CreateCloudTableClient();

             return cloudTableClient.GetDataServiceContext();
        }
    }
}
